package java_class_work.week05;

import java.io.FileNotFoundException;
import java.io.PrintStream;

/**
 * @Auther: admin
 * @Date: 2022/10/11 14:25
 * @Description:
 */

public class PrintStreamDemo {
    public static void main(String[] args) {
        String fileName = ".\\src\\java_class_work\\iotest\\writer.txt";
        try {
            PrintStream ps = new PrintStream(fileName);
//            ps = new PrintStream(new FileOutputStream(new File(fileName)));
            ps.println("总有些惊奇的际遇，");
            ps.println("比方说当我遇见你。");
            ps.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
